// Fill out your copyright notice in the Description page of Project Settings.


#include "STShotLocalPlayer.h"
#include "Engine/World.h"
#include "GameFramework/Actor.h"
#include "Kismet/GameplayStatics.h"


void USTShotLocalPlayer::SetViewPoint(FScreenshotInfo ViewInfo) {
	shotViewInfo = ViewInfo;
	UWorld* showWorld = shotViewInfo.worldTargetActor->GetWorld();
	if (showWorld) {
		GLog->Log("getWorld");
		ViewportClient = showWorld->GetGameViewport();
		PlayerController = UGameplayStatics::GetPlayerController(showWorld,0);
		GLog->Log("getWorld``");
	}
	Origin = FVector2D::ZeroVector;
	Size = FVector2D::One();
	LastViewLocation = shotViewInfo.minimalViewInfo.Location;

}
void USTShotLocalPlayer::ReleaseView() {
	shotViewInfo.Release();
}

void USTShotLocalPlayer::GetViewPoint(FMinimalViewInfo& OutViewInfo) const 
{
	OutViewInfo = shotViewInfo.minimalViewInfo;
}

